import { createBrowserRouter } from 'react-router-dom'

import Home from '../parges/Home'
import Login from '../parges/Login'
import Index from '../parges/Index'
import List from '../parges/List'
import Loginlist from '../parges/Loginlist'
import I404 from '../parges/404'
import Translate from '../parges/Translate'


export const routerlist = [
    {
        index: true,
        element: <Index />,
    },
    {
        path: '/home',
        element: <Index></Index>,
        title: 'home'  // 改为国际化键值
    },
    {
        path: '/list',
        element: <List></List>,
        title: 'List'  // 改为国际化键值
    },
    {
        path: '/translate',
        element: <Translate></Translate>,
        title: 'Translate'  // 改为国际化键值
    }
]

const router = createBrowserRouter([
    {
        path: '/',
        element: <Home />,
        children: routerlist
    },
    {
        path: '/login',
        element: <Login></Login>
    },
    {
        path: '/loginlist',
        element: <Loginlist></Loginlist>
    },
    {
        path: '/*',
        element: <I404 />
    }
])

export default router